
import { Button,Spin} from 'antd';
import {WeaLocaleProvider, WeaDialog, WeaSelect, WeaFormItem} from "ecCom"
import {inject, observer} from "mobx-react";
import {toJS} from 'mobx';
import ProjectCondition from '../list/projectCondition';
const getLabel = WeaLocaleProvider.getLabel;

@observer
class AddPrjGroupDialog extends React.Component {
    constructor(props) {
        super(props);
        this.state={
            width:1020,
            height:650,
        }
    }

    render() {
        const {prjGroupStore} = this.props;
        const {visible,handlePrjGroupDialog,fieldinfo,form,setFormFields,title} = prjGroupStore;
        return (
            <div>
                <WeaDialog ecId={`${this && this.props && this.props.ecId || ''}_WeaDialog@jhbhzc`}
                    title={title||getLabel(518163,'新建项目分组')}
                    visible={visible}
                    // style= {{width: width, height: dialogHeight}}
                    maskClosable={false}
                    icon="icon-coms-project"
                    iconBgcolor="#217346"
                    onCancel={()=>handlePrjGroupDialog(false)}
                    buttons={this.getDialogButtons()}
                >
                    <ProjectCondition ecId={`${this && this.props && this.props.ecId || ''}_ProjectCondition@x34q5x`} fieldInfo={fieldinfo} form={form} setFormFields={(v)=>{setFormFields(v)}} />
                </WeaDialog>
            </div>)
    }

    getDialogButtons(){
        const {projectPortalStore,prjGroupStore} = this.props;
        let btn = [];
        btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@qac3az@save`}  type="primary" onClick={()=>{prjGroupStore.savePrjGroupInfo(projectPortalStore);}}>{getLabel(86,"保存")}</Button>);
        btn.push(<Button ecId={`${this && this.props && this.props.ecId || ''}_Button@f4666n@clsoe`}  type="primary" onClick={()=>prjGroupStore.handlePrjGroupDialog(false)}>{getLabel(309,"关闭")}</Button>);
        return btn
    }

}

export default AddPrjGroupDialog;